<?php

class Public_TagSuccessView extends Public_IndexSuccessView
{
    protected $tag_name;
    
    public function executeHtml(AgaviRequestDataHolder $rd)
    {
        $this->tag_name = $rd->getParameter('tag');
        
        $res = parent::executeHtml($rd);
        $this->setAttribute('title', sprintf('Tag “%s”', $this->tag_name));
        return $res;
    }
    
    protected function findPosts()
    {
        /* @var $model Public_PostsModel */
        $model = $this->context->getModel('Posts', 'Public');
        
        return $model->findBlogPostsByTag($this->tag_name);	    
    }
}

?>